﻿using Electronic_work_order.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Electronic_work_order.Interfacess.OA_Ordering
{
    public class SqlOrdering : IOrdering
    {
        private readonly AppDbContext _context;

        public SqlOrdering(AppDbContext context)
        {
            _context = context;
        }

        public int AddOrdering(Ordering ordering)
        {
            _context.ordering.Add(ordering);
            return _context.SaveChanges();
        }

        public IEnumerable<OrderState> GetOrderState()
        {
            return _context.OrderStates.ToList();
        }

        public IEnumerable<Set_meal> GetSet_meal()
        {
            return _context.setmeal.ToList();
        }
    }
}
